package chapter3.homework;

/**
 * 斐波那契数列，求斐波那契数列中第 n 个元素的值是多少？
 *
 * @author 作者姓名 12345688
 */
public class Fibonacci {
    public static void main(String[] args) {
        long n = 202451208088888888L % 50;
        int first = 0;
        int second = 1;
        int result = 0;
        for (int i = 2; i <= n; i++) {
            result = first + second;
            first = second;
            second = result;
        }
        System.out.printf("第 %d 个元素是 %d", n, result);
    }
}
